﻿using AutoWrapper.Wrappers;
using Casbin.NET.Adapter.Dapper;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NetCasbin;
using NetCasbin.Persist;

namespace CasbinAutofacDemo
{
    [Route("Demo")]
    [ApiController]
    public class DemoController : ControllerBase
    {
        private readonly IServiceProvider serviceProvider;

        /// <summary>
        /// 构造函数
        /// </summary>
        public DemoController(IServiceProvider _serviceProvider)
        {
            serviceProvider = _serviceProvider;
        }

        /// <summary>
        /// 测试Casbin功能
        /// </summary>
        /// <returns></returns>
        [HttpGet("TestCasbin")]
        public ApiResponse TestCasbin()
        {
            return new ApiResponse("ok");
        }
    }
}